<template>
  <h3>toRow</h3>
  <p>{{ obj1.a }}---{{ obj1.b }}</p>
  <a-button @click="changObj1">toRow</a-button>
</template>

<script setup lang="ts">
import { reactive, toRaw } from 'vue'

let obj1 = reactive({
  a: 1,
  b: 2
})
// 会改变原数据，但是不更新页面
let obj11 = toRaw(obj1)
const changObj1 = () => {
  obj11.b += 1
  console.log(obj1, obj11)
}

const obj2 = {
  a: 1
}
// Object.assign合并数组
Object.assign(obj2, { b: 2 })
// console.log(obj2);
</script>

<style scoped></style>
